-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix user commands in terminal with function calling #4955
Conversation
Awesome that you're fixing this, I was just about to file a bug on this exact problem. What if the user bash messages are just never shown to the LLM? |
It's a good question, it could go either way. It happens in the same time with the task, and we know we need to tell the agent when the user is making modifications, rather than just looking. 🤔 Please take a look also at the slack discussion. |
Yes, it could go either way, made a UX suggestion to just have a checkbox on top of the terminal tab to let user decide whether his commands should be shown to the LLM |
Currently:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM! Thanks a bunch for this!
Co-authored-by: Xingyao Wang <[email protected]>
Co-authored-by: Xingyao Wang <[email protected]>
…ds into enyst/user-commands
End-user friendly description of the problem this fixes or functionality that this introduces
Fix agent crash when terminal commands are sent and function calling is enabled
Give a summary of what the PR does, explaining any non-trivial design decisions
When function calling is enabled, the agent expected all CmdRunAction to be "tools", but if they were sent by the user in the terminal, they were not, they were regular command actions.
This PR proposes to convert them into Messages as usual pre-function calling. Since they have source 'user', same as the next observation, and potentially more (a user message in chat probably follows too), they all get added to the same Message with role='user' when sent to the LLM.
(Outdated now)
On a side note, the concatenation... worked too well, so much so that Claude felt the need to help the human:
Prompt:
LLM response:
😅
Maybe we should insert some mini-separators?Done.
Link of any specific issues this addresses
Fix #4783
To run this PR locally, use the following command: